package org.beehoo.graphicsComponents;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class OpaqueCellRenderer extends JLabel implements ListCellRenderer {

	final static ImageIcon longIcon = new ImageIcon("/images/060.gif");
    final static ImageIcon shortIcon = new ImageIcon("/images/0062.gif");


	public OpaqueCellRenderer() {
		// TODO Auto-generated constructor stub
	}

	public OpaqueCellRenderer(String arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	public OpaqueCellRenderer(Icon arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	public OpaqueCellRenderer(String arg0, int arg1) {
		super(arg0, arg1);
		// TODO Auto-generated constructor stub
	}

	public OpaqueCellRenderer(Icon arg0, int arg1) {
		super(arg0, arg1);
		// TODO Auto-generated constructor stub
	}

	public OpaqueCellRenderer(String arg0, Icon arg1, int arg2) {
		super(arg0, arg1, arg2);
		// TODO Auto-generated constructor stub
	}

	public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus)    
	{
		// TODO Auto-generated method stub
		String s = value.toString();
		setText(s);
		if (isSelected) {
			setBackground(list.getSelectionBackground());
			setForeground(Color.blue);
			setIcon(new ImageIcon(getClass().getResource("/images/151(2).gif")));
			setFont(new Font("Arial Black", Font.PLAIN, 10));
		} else {
			setBackground(list.getBackground());
			setForeground(Color.black);
			setIcon(new ImageIcon(getClass().getResource("/images/151(1).gif")));
			setFont(new Font("Arial", Font.PLAIN, 10));
		}
		setEnabled(list.isEnabled());
		
		
		
		setOpaque(false);
		
		return this;
	}

}
